<template>
  <el-icon class="collapse-icon" @click="changeCollapse">
    <svg
      data-v-49e15297=""
      viewBox="0 0 1024 1024"
      xmlns="http://www.w3.org/2000/svg"
      width="64"
      height="64"
      class="hamburger"
      :class="{
        'is-active': !globalStore.isCollapse
      }"
    >
      <path
        data-v-49e15297=""
        d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z"
      ></path>
    </svg>
    <!-- <component :is="globalStore.isCollapse ? 'expand' : 'fold'"></component> -->
  </el-icon>
</template>

<script setup>
import { useGlobalStore } from '@/stores/modules/global'

const globalStore = useGlobalStore()
const changeCollapse = () => {
  globalStore.setGlobalState('isCollapse', !globalStore.isCollapse)
}
</script>

<style scoped lang="scss">
.collapse-icon {
  margin-right: 20px;
  font-size: 20px;
  /* color: var(--el-header-text-color); */
  cursor: pointer;
}

.hamburger.is-active {
  -webkit-transform: rotate(180deg);
  transform: rotate(180deg);
}
.hamburger {
  display: inline-block;
  vertical-align: middle;
  width: 20px;
  height: 20px;
}
</style>
